using System;
using UnityEngine;
public class ObjectProjectVEx:IVEx
{
public void SetData(ComponentData d){Debug.Assert(TargetType.IsAssignableFrom(d.ComponentType));_data=new WeakReference<ComponentData>(d);}
public ObjectProjectVEx(ComponentData d){SetData(d);}
public ObjectProjectVEx(){}
WeakReference<ComponentData> _data;
public UInt32 CompIdentity{get{if(_data.TryGetTarget(out ComponentData data))return data.CompIdentity;else throw new NullReferenceException("弱引用未找到");}}
public  Type TargetType=>typeof(ElementProject);
public ComponentData Data{get{if(_data.TryGetTarget(out ComponentData data))return data;
else throw new NullReferenceException("弱引用未找到");}}
public System.String FuncName {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<System.String>(0);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<System.String>(0,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort FuncNameId{get=>(ushort)0;}
public System.String FuncInfo {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<System.String>(1);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<System.String>(1,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort FuncInfoId{get=>(ushort)1;}
public UnityEngine.KeyCode Key {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<UnityEngine.KeyCode>(2);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<UnityEngine.KeyCode>(2,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort KeyId{get=>(ushort)2;}

}
